package com.cps.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.support.rowset.SqlRowSet;

public class BaseDao {
	protected JdbcTemplate jdbcTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public SqlRowSet getAll(String tableName){
		return this.jdbcTemplate.queryForRowSet("select * from "+tableName);
	}
	
	public SqlRowSet query(String sql,Object...objects){
		return this.jdbcTemplate.queryForRowSet(sql,objects);
	}
	

	
}
